using System;
using System.Collections.Generic;
using Entitas;

public sealed class AnimateOutOfScreenViewSystem : ReactiveSystem {
    
    public AnimateOutOfScreenViewSystem(Contexts contexts) : base(contexts.core)
    {
    }

    protected override void Execute(List<Entity> entities) {
        foreach(var e in entities) {
            var controller = e.view.controller;
            controller.Hide(false);
        }
    }

    protected override Collector GetTrigger(Context context)
    {
        return context.CreateCollector(Matcher.AllOf(CoreMatcher.View, CoreMatcher.OutOfScreen));
    }

    protected override bool Filter(Entity entity)
    {
        return true;
    }

}
